<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  <script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
  <div id="app">
    <el-button @click="refresh">Click</el-button>
    <span>Count: {{count}}</span>
  </div>
</body>
<script>
  new Vue({
    el: '#app',
    data: function() {
      return { 
        count: 0
      }
    },
    mounted() {
      this.refresh()
    },
    methods: {
      refresh() {
        let $this = this;
        axios.get("/api/plugins/ui_counter/count").then(function(e){
          console.log(e)
          $this.count = e.data.data
          
          $this.$notify({
            type: "success",
            message: "点击量+1"
          })
        })
      }
    }
  })
</script>
</html>